@backstage/plugin-scaffolder-backend-module-confluence-to-markdown 0.1.3 → 0.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/README.md +13 -9
- package/config.d.ts +26 -24
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-confluence-to-markdown
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0a7e7c5d0c04: **BREAKING**
|
|
8
|
+
|
|
9
|
+
This change updates the configuration of the confluence-to-markdown action so that it does not conflict with other confluence plguins. Currently many plugins make use of the `confluence.auth` configuration. However, only the confluence-to-markdown action uses the `confluence.auth` as a string. This change updates it so that `confluence.auth` is an object.
|
|
10
|
+
|
|
11
|
+
## Required Changes
|
|
12
|
+
|
|
13
|
+
Below are examples for updating `bearer`, `basic`, and `userpass` implementations.
|
|
14
|
+
|
|
15
|
+
For `bearer`:
|
|
16
|
+
Before:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
confluence:
|
|
20
|
+
baseUrl: 'https://confluence.example.com'
|
|
21
|
+
auth: 'bearer'
|
|
22
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
After:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
confluence:
|
|
29
|
+
baseUrl: 'https://confluence.example.com'
|
|
30
|
+
auth:
|
|
31
|
+
type: 'bearer'
|
|
32
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For `basic`:
|
|
36
|
+
|
|
37
|
+
Before:
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
confluence:
|
|
41
|
+
baseUrl: 'https://confluence.example.com'
|
|
42
|
+
auth: 'basic'
|
|
43
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
44
|
+
email: 'example@company.org'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
After:
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
confluence:
|
|
51
|
+
baseUrl: 'https://confluence.example.com'
|
|
52
|
+
auth:
|
|
53
|
+
type: 'basic'
|
|
54
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
55
|
+
email: 'example@company.org'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For `userpass`
|
|
59
|
+
Before:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
confluence:
|
|
63
|
+
baseUrl: 'https://confluence.example.com'
|
|
64
|
+
auth: 'userpass'
|
|
65
|
+
username: 'your-username'
|
|
66
|
+
password: 'your-password'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
After:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
confluence:
|
|
73
|
+
baseUrl: 'https://confluence.example.com'
|
|
74
|
+
auth:
|
|
75
|
+
type: 'userpass'
|
|
76
|
+
username: 'your-username'
|
|
77
|
+
password: 'your-password'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies
|
|
83
|
+
- @backstage/plugin-scaffolder-backend@1.15.1-next.1
|
|
84
|
+
- @backstage/backend-common@0.19.1-next.0
|
|
85
|
+
- @backstage/config@1.0.8
|
|
86
|
+
- @backstage/errors@1.2.1-next.0
|
|
87
|
+
- @backstage/integration@1.5.1-next.0
|
|
88
|
+
- @backstage/types@1.1.0
|
|
89
|
+
- @backstage/plugin-scaffolder-node@0.1.5-next.0
|
|
90
|
+
|
|
91
|
+
## 0.1.4-next.0
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies
|
|
96
|
+
- @backstage/errors@1.2.1-next.0
|
|
97
|
+
- @backstage/backend-common@0.19.1-next.0
|
|
98
|
+
- @backstage/config@1.0.8
|
|
99
|
+
- @backstage/integration@1.5.1-next.0
|
|
100
|
+
- @backstage/types@1.1.0
|
|
101
|
+
- @backstage/plugin-scaffolder-backend@1.15.1-next.0
|
|
102
|
+
- @backstage/plugin-scaffolder-node@0.1.5-next.0
|
|
103
|
+
|
|
3
104
|
## 0.1.3
|
|
4
105
|
|
|
5
106
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -65,7 +65,8 @@ There is some configuration that needs to be setup to use this action, these are
|
|
|
65
65
|
```yaml
|
|
66
66
|
confluence:
|
|
67
67
|
baseUrl: 'https://confluence.example.com'
|
|
68
|
-
|
|
68
|
+
auth:
|
|
69
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
The sections below will go into more details about the Base URL and Auth Methods.
|
|
@@ -85,8 +86,9 @@ For `bearer`:
|
|
|
85
86
|
```yaml
|
|
86
87
|
confluence:
|
|
87
88
|
baseUrl: 'https://confluence.example.com'
|
|
88
|
-
auth:
|
|
89
|
-
|
|
89
|
+
auth:
|
|
90
|
+
type: 'bearer'
|
|
91
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
90
92
|
```
|
|
91
93
|
|
|
92
94
|
For `basic`:
|
|
@@ -94,9 +96,10 @@ For `basic`:
|
|
|
94
96
|
```yaml
|
|
95
97
|
confluence:
|
|
96
98
|
baseUrl: 'https://confluence.example.com'
|
|
97
|
-
auth:
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
auth:
|
|
100
|
+
type: 'basic'
|
|
101
|
+
token: '${CONFLUENCE_TOKEN}'
|
|
102
|
+
email: 'example@company.org'
|
|
100
103
|
```
|
|
101
104
|
|
|
102
105
|
For `userpass`
|
|
@@ -104,9 +107,10 @@ For `userpass`
|
|
|
104
107
|
```yaml
|
|
105
108
|
confluence:
|
|
106
109
|
baseUrl: 'https://confluence.example.com'
|
|
107
|
-
auth:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
auth:
|
|
111
|
+
type: 'userpass'
|
|
112
|
+
username: 'your-username'
|
|
113
|
+
password: 'your-password'
|
|
110
114
|
```
|
|
111
115
|
|
|
112
116
|
**Note:** For `basic` and `bearer` authorization methods you will need an access token for authorization with `Read` permissions. You can create a Personal Access Token (PAT) in Confluence. The value used should be the raw token as it will be encoded for you by the action.
|
package/config.d.ts
CHANGED
|
@@ -21,29 +21,31 @@ export interface Config {
|
|
|
21
21
|
* The base URL for accessing the Confluence API
|
|
22
22
|
*/
|
|
23
23
|
baseUrl: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
auth: {
|
|
25
|
+
/**
|
|
26
|
+
* Authentication method - basic, bearer, username/password
|
|
27
|
+
*/
|
|
28
|
+
type: 'basic' | 'bearer' | 'userpass';
|
|
29
|
+
/**
|
|
30
|
+
* Token used for the basic and bearer auth methods
|
|
31
|
+
* @visibility secret
|
|
32
|
+
*/
|
|
33
|
+
token?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Email used with the token for the basic auth method
|
|
36
|
+
* @visibility secret
|
|
37
|
+
*/
|
|
38
|
+
email?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Username used with the Username/Password auth method
|
|
41
|
+
* @visibility secret
|
|
42
|
+
*/
|
|
43
|
+
username?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Password used with the Username/Password auth method
|
|
46
|
+
* @visibility secret
|
|
47
|
+
*/
|
|
48
|
+
password?: string;
|
|
49
|
+
};
|
|
48
50
|
};
|
|
49
51
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -22,11 +22,11 @@ const getConfluenceConfig = (config) => {
|
|
|
22
22
|
var _a;
|
|
23
23
|
const confluenceConfig = {
|
|
24
24
|
baseUrl: config.getString("confluence.baseUrl"),
|
|
25
|
-
auth: (_a = config.getOptionalString("confluence.auth")) != null ? _a : "bearer",
|
|
26
|
-
token: config.getOptionalString("confluence.token"),
|
|
27
|
-
email: config.getOptionalString("confluence.email"),
|
|
28
|
-
username: config.getOptionalString("confluence.username"),
|
|
29
|
-
password: config.getOptionalString("confluence.password")
|
|
25
|
+
auth: (_a = config.getOptionalString("confluence.auth.type")) != null ? _a : "bearer",
|
|
26
|
+
token: config.getOptionalString("confluence.auth.token"),
|
|
27
|
+
email: config.getOptionalString("confluence.auth.email"),
|
|
28
|
+
username: config.getOptionalString("confluence.auth.username"),
|
|
29
|
+
password: config.getOptionalString("confluence.auth.password")
|
|
30
30
|
};
|
|
31
31
|
if ((confluenceConfig.auth === "basic" || confluenceConfig.auth === "bearer") && !confluenceConfig.token) {
|
|
32
32
|
throw new Error(
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/actions/confluence/helpers.ts","../src/actions/confluence/confluenceToMarkdown.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { ResponseError, ConflictError, InputError } from '@backstage/errors';\nimport fs from 'fs-extra';\nimport fetch, { Response } from 'node-fetch';\n\ninterface Links {\n webui: string;\n download: string;\n thumbnail: string;\n self: string;\n}\n\ninterface Metadata {\n mediaType: string;\n}\n\nexport interface Result {\n id: string;\n type: string;\n status: string;\n title: string;\n metadata: Metadata;\n _links: Links;\n}\n\nexport interface Results {\n results: Result[];\n}\n\nexport type ConfluenceConfig = {\n baseUrl: string;\n auth: string;\n token?: string;\n email?: string;\n username?: string;\n password?: string;\n};\n\nexport const getConfluenceConfig = (config: Config) => {\n const confluenceConfig: ConfluenceConfig = {\n baseUrl: config.getString('confluence.baseUrl'),\n auth: config.getOptionalString('confluence.auth') ?? 'bearer',\n token: config.getOptionalString('confluence.token'),\n email: config.getOptionalString('confluence.email'),\n username: config.getOptionalString('confluence.username'),\n password: config.getOptionalString('confluence.password'),\n };\n\n if (\n (confluenceConfig.auth === 'basic' || confluenceConfig.auth === 'bearer') &&\n !confluenceConfig.token\n ) {\n throw new Error(\n `No token provided for the configured '${confluenceConfig.auth}' auth method`,\n );\n }\n\n if (confluenceConfig.auth === 'basic' && !confluenceConfig.email) {\n throw new Error(\n `No email provided for the configured '${confluenceConfig.auth}' auth method`,\n );\n }\n\n if (\n confluenceConfig.auth === 'userpass' &&\n (!confluenceConfig.username || !confluenceConfig.password)\n ) {\n throw new Error(\n `No username/password provided for the configured '${confluenceConfig.auth}' auth method`,\n );\n }\n\n return confluenceConfig;\n};\n\nexport const getAuthorizationHeaderValue = (config: ConfluenceConfig) => {\n switch (config.auth) {\n case 'bearer':\n return `Bearer ${config.token}`;\n case 'basic': {\n const buffer = Buffer.from(`${config.email}:${config.token}`, 'utf8');\n return `Basic ${buffer.toString('base64')}`;\n }\n case 'userpass': {\n const buffer = Buffer.from(\n `${config.username}:${config.password}`,\n 'utf8',\n );\n return `Basic ${buffer.toString('base64')}`;\n }\n default:\n throw new Error(`Unknown auth method '${config.auth}' provided`);\n }\n};\n\nexport const readFileAsString = async (fileDir: string) => {\n const content = await fs.readFile(fileDir, 'utf-8');\n return content.toString();\n};\n\nexport const fetchConfluence = async (\n relativeUrl: string,\n config: ConfluenceConfig,\n) => {\n const baseUrl = config.baseUrl;\n const authHeaderValue = getAuthorizationHeaderValue(config);\n const url = `${baseUrl}${relativeUrl}`;\n const response: Response = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: authHeaderValue,\n },\n });\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json();\n};\n\nexport const getAndWriteAttachments = async (\n arr: Results,\n workspace: string,\n config: ConfluenceConfig,\n mkdocsDir: string,\n) => {\n const productArr: string[][] = [];\n const baseUrl = config.baseUrl;\n const authHeaderValue = getAuthorizationHeaderValue(config);\n await Promise.all(\n await arr.results.map(async (result: Result) => {\n const downloadLink = result._links.download;\n const downloadTitle = result.title.replace(/ /g, '-');\n if (result.metadata.mediaType !== 'application/gliffy+json') {\n productArr.push([result.title.replace(/ /g, '%20'), downloadTitle]);\n }\n const url = `${baseUrl}${downloadLink}`;\n const res = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: authHeaderValue,\n },\n });\n if (!res.ok) {\n throw await ResponseError.fromResponse(res);\n } else if (res.body !== null) {\n fs.openSync(`${workspace}/${mkdocsDir}docs/img/${downloadTitle}`, 'w');\n const writeStream = fs.createWriteStream(\n `${workspace}/${mkdocsDir}docs/img/${downloadTitle}`,\n );\n res.body.pipe(writeStream);\n await new Promise((resolve, reject) => {\n writeStream.on('finish', () => {\n resolve(`${workspace}/${mkdocsDir}docs/img/${downloadTitle}`);\n });\n writeStream.on('error', reject);\n });\n } else {\n throw new ConflictError(\n 'No Body on the response. Can not save images from Confluence Doc',\n );\n }\n }),\n );\n return productArr;\n};\n\nexport const createConfluenceVariables = (url: string) => {\n let spacekey: string | undefined = undefined;\n let title: string | undefined = undefined;\n let titleWithSpaces: string | undefined = '';\n const params = new URL(url);\n if (params.pathname.split('/')[1] === 'display') {\n // https://confluence.example.com/display/SPACEKEY/Page+Title\n spacekey = params.pathname.split('/')[2];\n title = params.pathname.split('/')[3];\n titleWithSpaces = title?.replace(/\\+/g, ' ');\n return { spacekey, title, titleWithSpaces };\n } else if (params.pathname.split('/')[2] === 'display') {\n // https://confluence.example.com/prefix/display/SPACEKEY/Page+Title\n spacekey = params.pathname.split('/')[3];\n title = params.pathname.split('/')[4];\n titleWithSpaces = title?.replace(/\\+/g, ' ');\n return { spacekey, title, titleWithSpaces };\n } else if (params.pathname.split('/')[2] === 'spaces') {\n // https://example.atlassian.net/wiki/spaces/SPACEKEY/pages/1234567/Page+Title\n spacekey = params.pathname.split('/')[3];\n title = params.pathname.split('/')[6];\n titleWithSpaces = title?.replace(/\\+/g, ' ');\n return { spacekey, title, titleWithSpaces };\n }\n throw new InputError(\n 'The Url format for Confluence is incorrect. Acceptable format is `<CONFLUENCE_BASE_URL>/display/<SPACEKEY>/<PAGE+TITLE>` or `<CONFLUENCE_BASE_URL>/spaces/<SPACEKEY>/pages/<PAGEID>/<PAGE+TITLE>` for Confluence cloud',\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Config } from '@backstage/config';\nimport { UrlReader } from '@backstage/backend-common';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { createFetchPlainAction } from '@backstage/plugin-scaffolder-backend';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { InputError, ConflictError } from '@backstage/errors';\nimport { NodeHtmlMarkdown } from 'node-html-markdown';\nimport fs from 'fs-extra';\nimport parseGitUrl from 'git-url-parse';\nimport YAML from 'yaml';\nimport {\n readFileAsString,\n fetchConfluence,\n getAndWriteAttachments,\n createConfluenceVariables,\n getConfluenceConfig,\n} from './helpers';\n\n/**\n * @public\n */\n\nexport const createConfluenceToMarkdownAction = (options: {\n reader: UrlReader;\n integrations: ScmIntegrations;\n config: Config;\n}) => {\n const { config, reader, integrations } = options;\n const fetchPlainAction = createFetchPlainAction({ reader, integrations });\n type Obj = {\n [key: string]: string;\n };\n\n return createTemplateAction<{\n confluenceUrls: string[];\n repoUrl: string;\n }>({\n id: 'confluence:transform:markdown',\n schema: {\n input: {\n properties: {\n confluenceUrls: {\n type: 'array',\n title: 'Confluence URL',\n description:\n 'Paste your Confluence url. Ensure it follows this format: https://{confluence+base+url}/display/{spacekey}/{page+title} or https://{confluence+base+url}/spaces/{spacekey}/pages/1234567/{page+title} for Confluence Cloud',\n items: {\n type: 'string',\n default: 'Confluence URL',\n },\n },\n repoUrl: {\n type: 'string',\n title: 'GitHub Repo Url',\n description:\n 'mkdocs.yml file location inside the github repo you want to store the document',\n },\n },\n },\n },\n async handler(ctx) {\n const confluenceConfig = getConfluenceConfig(config);\n const { confluenceUrls, repoUrl } = ctx.input;\n const parsedRepoUrl = parseGitUrl(repoUrl);\n const filePathToMkdocs = parsedRepoUrl.filepath.substring(\n 0,\n parsedRepoUrl.filepath.lastIndexOf('/') + 1,\n );\n const dirPath = ctx.workspacePath;\n let productArray: string[][] = [];\n\n ctx.logger.info(`Fetching the mkdocs.yml catalog from ${repoUrl}`);\n\n // This grabs the files from Github\n const repoFileDir = `${dirPath}/${parsedRepoUrl.filepath}`;\n await fetchPlainAction.handler({\n ...ctx,\n input: {\n url: `https://${parsedRepoUrl.resource}/${parsedRepoUrl.owner}/${parsedRepoUrl.name}`,\n targetPath: dirPath,\n },\n });\n\n for (const url of confluenceUrls) {\n const { spacekey, title, titleWithSpaces } =\n createConfluenceVariables(url);\n // This calls confluence to get the page html and page id\n ctx.logger.info(`Fetching the Confluence content for ${url}`);\n const getConfluenceDoc = await fetchConfluence(\n `/rest/api/content?title=${title}&spaceKey=${spacekey}&expand=body.export_view`,\n confluenceConfig,\n );\n if (getConfluenceDoc.results.length === 0) {\n throw new InputError(\n `Could not find document ${url}. Please check your input.`,\n );\n }\n // This gets attachments for the confluence page if they exist\n const getDocAttachments = await fetchConfluence(\n `/rest/api/content/${getConfluenceDoc.results[0].id}/child/attachment`,\n confluenceConfig,\n );\n\n if (getDocAttachments.results.length) {\n fs.mkdirSync(`${dirPath}/${filePathToMkdocs}docs/img`, {\n recursive: true,\n });\n productArray = await getAndWriteAttachments(\n getDocAttachments,\n dirPath,\n confluenceConfig,\n filePathToMkdocs,\n );\n }\n\n ctx.logger.info(\n `starting action for converting ${titleWithSpaces} from Confluence To Markdown`,\n );\n\n // This reads mkdocs.yml file\n const mkdocsFileContent = await readFileAsString(repoFileDir);\n const mkdocsFile = await YAML.parse(mkdocsFileContent);\n ctx.logger.info(\n `Adding new file - ${titleWithSpaces} to the current mkdocs.yml file`,\n );\n\n // This modifies the mkdocs.yml file\n if (mkdocsFile !== undefined && mkdocsFile.hasOwnProperty('nav')) {\n const { nav } = mkdocsFile;\n if (!nav.some((i: Obj) => i.hasOwnProperty(titleWithSpaces))) {\n nav.push({\n [titleWithSpaces]: `${titleWithSpaces.replace(/\\s+/g, '-')}.md`,\n });\n mkdocsFile.nav = nav;\n } else {\n throw new ConflictError(\n 'This document looks to exist inside the GitHub repo. Will end the action.',\n );\n }\n }\n\n await fs.writeFile(repoFileDir, YAML.stringify(mkdocsFile));\n\n // This grabs the confluence html and converts it to markdown and adds attachments\n const html = getConfluenceDoc.results[0].body.export_view.value;\n const markdownToPublish = NodeHtmlMarkdown.translate(html);\n let newString: string = markdownToPublish;\n productArray.forEach((product: string[]) => {\n // This regex is looking for either [](link to confluence) or  in the newly created markdown doc and updating it to point to the versions saved(in ./docs/img) in the local version of GitHub Repo during getAndWriteAttachments\n const regex = product[0].includes('.pdf')\n ? new RegExp(`(\\\\[.*?\\\\]\\\\()(.*?${product[0]}.*?)(\\\\))`, 'gi')\n : new RegExp(`(\\\\!\\\\[.*?\\\\]\\\\()(.*?${product[0]}.*?)(\\\\))`, 'gi');\n newString = newString.replace(regex, `$1./img/${product[1]}$3`);\n });\n\n ctx.logger.info(`Adding new file to repo.`);\n await fs.outputFile(\n `${dirPath}/${filePathToMkdocs}docs/${titleWithSpaces.replace(\n /\\s+/g,\n '-',\n )}.md`,\n newString,\n );\n }\n\n ctx.output('repo', parsedRepoUrl.name);\n ctx.output('owner', parsedRepoUrl.owner);\n },\n });\n};\n"],"names":["fs","fetch","ResponseError","ConflictError","InputError","createFetchPlainAction","createTemplateAction","parseGitUrl","YAML","NodeHtmlMarkdown"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDa,MAAA,mBAAA,GAAsB,CAAC,MAAmB,KAAA;AAtDvD,EAAA,IAAA,EAAA,CAAA;AAuDE,EAAA,MAAM,gBAAqC,GAAA;AAAA,IACzC,OAAA,EAAS,MAAO,CAAA,SAAA,CAAU,oBAAoB,CAAA;AAAA,IAC9C,IAAM,EAAA,CAAA,EAAA,GAAA,MAAA,CAAO,iBAAkB,CAAA,iBAAiB,MAA1C,IAA+C,GAAA,EAAA,GAAA,QAAA;AAAA,IACrD,KAAA,EAAO,MAAO,CAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAAA,IAClD,KAAA,EAAO,MAAO,CAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAAA,IAClD,QAAA,EAAU,MAAO,CAAA,iBAAA,CAAkB,qBAAqB,CAAA;AAAA,IACxD,QAAA,EAAU,MAAO,CAAA,iBAAA,CAAkB,qBAAqB,CAAA;AAAA,GAC1D,CAAA;AAEA,EACG,IAAA,CAAA,gBAAA,CAAiB,SAAS,OAAW,IAAA,gBAAA,CAAiB,SAAS,QAChE,KAAA,CAAC,iBAAiB,KAClB,EAAA;AACA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,yCAAyC,gBAAiB,CAAA,IAAA,CAAA,aAAA,CAAA;AAAA,KAC5D,CAAA;AAAA,GACF;AAEA,EAAA,IAAI,gBAAiB,CAAA,IA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AAa,YAAA,CAAA,OAAA,CAAQ,CAAC,OAAsB,KAAA;AAE1C,UAAM,MAAA,KAAA,GAAQ,QAAQ,CAAC,CAAA,CAAE,SAAS,MAAM,CAAA,GACpC,IAAI,MAAO,CAAA,CAAA,kBAAA,EAAqB,QAAQ,CAAC,CAAA,CAAA,SAAA,CAAA,EAAc,IAAI,CAC3D,GAAA,IAAI,OAAO,CAAwB,qBAAA,EAAA,OAAA,CAAQ,CAAC,CAAA,CAAA,SAAA,CAAA,EAAc,IAAI,CAAA,CAAA;AAClE,UAAA,SAAA,GAAY,UAAU,OAAQ,CAAA,KAAA,EAAO,CAAW,QAAA,EAAA,OAAA,CAAQ,CAAC,CAAK,CAAA,EAAA,CAAA,CAAA,CAAA;AAAA,SAC/D,CAAA,CAAA;AAED,QAAI,GAAA,CAAA,MAAA,CAAO,KAAK,CAA0B,wBAAA,CAAA,CAAA,CAAA;AAC1C,QAAA,MAAMT,sBAAG,CAAA,UAAA;AAAA,UACP,CAAA,EAAG,OAAW,CAAA,CAAA,EAAA,gBAAA,CAAA,KAAA,EAAwB,eAAgB,CAAA,OAAA;AAAA,YACpD,MAAA;AAAA,YACA,GAAA;AAAA,WACF,CAAA,GAAA,CAAA;AAAA,UACA,SAAA;AAAA,SACF,CAAA;AAAA,OACF;AAEA,MAAI,GAAA,CAAA,MAAA,CAAO,MAAQ,EAAA,aAAA,CAAc,IAAI,CAAA,CAAA;AACrC,MAAI,GAAA,CAAA,MAAA,CAAO,OAAS,EAAA,aAAA,CAAc,KAAK,CAAA,CAAA;AAAA,KACzC;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/actions/confluence/helpers.ts","../src/actions/confluence/confluenceToMarkdown.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { ResponseError, ConflictError, InputError } from '@backstage/errors';\nimport fs from 'fs-extra';\nimport fetch, { Response } from 'node-fetch';\n\ninterface Links {\n webui: string;\n download: string;\n thumbnail: string;\n self: string;\n}\n\ninterface Metadata {\n mediaType: string;\n}\n\nexport interface Result {\n id: string;\n type: string;\n status: string;\n title: string;\n metadata: Metadata;\n _links: Links;\n}\n\nexport interface Results {\n results: Result[];\n}\n\nexport type LocalConfluenceConfig = {\n baseUrl: string;\n auth: string;\n token?: string;\n email?: string;\n username?: string;\n password?: string;\n};\n\nexport const getConfluenceConfig = (config: Config) => {\n const confluenceConfig = {\n baseUrl: config.getString('confluence.baseUrl'),\n auth: config.getOptionalString('confluence.auth.type') ?? 'bearer',\n token: config.getOptionalString('confluence.auth.token'),\n email: config.getOptionalString('confluence.auth.email'),\n username: config.getOptionalString('confluence.auth.username'),\n password: config.getOptionalString('confluence.auth.password'),\n };\n\n if (\n (confluenceConfig.auth === 'basic' || confluenceConfig.auth === 'bearer') &&\n !confluenceConfig.token\n ) {\n throw new Error(\n `No token provided for the configured '${confluenceConfig.auth}' auth method`,\n );\n }\n\n if (confluenceConfig.auth === 'basic' && !confluenceConfig.email) {\n throw new Error(\n `No email provided for the configured '${confluenceConfig.auth}' auth method`,\n );\n }\n\n if (\n confluenceConfig.auth === 'userpass' &&\n (!confluenceConfig.username || !confluenceConfig.password)\n ) {\n throw new Error(\n `No username/password provided for the configured '${confluenceConfig.auth}' auth method`,\n );\n }\n\n return confluenceConfig;\n};\n\nexport const getAuthorizationHeaderValue = (config: LocalConfluenceConfig) => {\n switch (config.auth) {\n case 'bearer':\n return `Bearer ${config.token}`;\n case 'basic': {\n const buffer = Buffer.from(`${config.email}:${config.token}`, 'utf8');\n return `Basic ${buffer.toString('base64')}`;\n }\n case 'userpass': {\n const buffer = Buffer.from(\n `${config.username}:${config.password}`,\n 'utf8',\n );\n return `Basic ${buffer.toString('base64')}`;\n }\n default:\n throw new Error(`Unknown auth method '${config.auth}' provided`);\n }\n};\n\nexport const readFileAsString = async (fileDir: string) => {\n const content = await fs.readFile(fileDir, 'utf-8');\n return content.toString();\n};\n\nexport const fetchConfluence = async (\n relativeUrl: string,\n config: LocalConfluenceConfig,\n) => {\n const baseUrl = config.baseUrl;\n const authHeaderValue = getAuthorizationHeaderValue(config);\n const url = `${baseUrl}${relativeUrl}`;\n const response: Response = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: authHeaderValue,\n },\n });\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json();\n};\n\nexport const getAndWriteAttachments = async (\n arr: Results,\n workspace: string,\n config: LocalConfluenceConfig,\n mkdocsDir: string,\n) => {\n const productArr: string[][] = [];\n const baseUrl = config.baseUrl;\n const authHeaderValue = getAuthorizationHeaderValue(config);\n await Promise.all(\n await arr.results.map(async (result: Result) => {\n const downloadLink = result._links.download;\n const downloadTitle = result.title.replace(/ /g, '-');\n if (result.metadata.mediaType !== 'application/gliffy+json') {\n productArr.push([result.title.replace(/ /g, '%20'), downloadTitle]);\n }\n const url = `${baseUrl}${downloadLink}`;\n const res = await fetch(url, {\n method: 'GET',\n headers: {\n Authorization: authHeaderValue,\n },\n });\n if (!res.ok) {\n throw await ResponseError.fromResponse(res);\n } else if (res.body !== null) {\n fs.openSync(`${workspace}/${mkdocsDir}docs/img/${downloadTitle}`, 'w');\n const writeStream = fs.createWriteStream(\n `${workspace}/${mkdocsDir}docs/img/${downloadTitle}`,\n );\n res.body.pipe(writeStream);\n await new Promise((resolve, reject) => {\n writeStream.on('finish', () => {\n resolve(`${workspace}/${mkdocsDir}docs/img/${downloadTitle}`);\n });\n writeStream.on('error', reject);\n });\n } else {\n throw new ConflictError(\n 'No Body on the response. Can not save images from Confluence Doc',\n );\n }\n }),\n );\n return productArr;\n};\n\nexport const createConfluenceVariables = (url: string) => {\n let spacekey: string | undefined = undefined;\n let title: string | undefined = undefined;\n let titleWithSpaces: string | undefined = '';\n const params = new URL(url);\n if (params.pathname.split('/')[1] === 'display') {\n // https://confluence.example.com/display/SPACEKEY/Page+Title\n spacekey = params.pathname.split('/')[2];\n title = params.pathname.split('/')[3];\n titleWithSpaces = title?.replace(/\\+/g, ' ');\n return { spacekey, title, titleWithSpaces };\n } else if (params.pathname.split('/')[2] === 'display') {\n // https://confluence.example.com/prefix/display/SPACEKEY/Page+Title\n spacekey = params.pathname.split('/')[3];\n title = params.pathname.split('/')[4];\n titleWithSpaces = title?.replace(/\\+/g, ' ');\n return { spacekey, title, titleWithSpaces };\n } else if (params.pathname.split('/')[2] === 'spaces') {\n // https://example.atlassian.net/wiki/spaces/SPACEKEY/pages/1234567/Page+Title\n spacekey = params.pathname.split('/')[3];\n title = params.pathname.split('/')[6];\n titleWithSpaces = title?.replace(/\\+/g, ' ');\n return { spacekey, title, titleWithSpaces };\n }\n throw new InputError(\n 'The Url format for Confluence is incorrect. Acceptable format is `<CONFLUENCE_BASE_URL>/display/<SPACEKEY>/<PAGE+TITLE>` or `<CONFLUENCE_BASE_URL>/spaces/<SPACEKEY>/pages/<PAGEID>/<PAGE+TITLE>` for Confluence cloud',\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Config } from '@backstage/config';\nimport { UrlReader } from '@backstage/backend-common';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { createFetchPlainAction } from '@backstage/plugin-scaffolder-backend';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { InputError, ConflictError } from '@backstage/errors';\nimport { NodeHtmlMarkdown } from 'node-html-markdown';\nimport fs from 'fs-extra';\nimport parseGitUrl from 'git-url-parse';\nimport YAML from 'yaml';\nimport {\n readFileAsString,\n fetchConfluence,\n getAndWriteAttachments,\n createConfluenceVariables,\n getConfluenceConfig,\n} from './helpers';\n\n/**\n * @public\n */\n\nexport const createConfluenceToMarkdownAction = (options: {\n reader: UrlReader;\n integrations: ScmIntegrations;\n config: Config;\n}) => {\n const { config, reader, integrations } = options;\n const fetchPlainAction = createFetchPlainAction({ reader, integrations });\n type Obj = {\n [key: string]: string;\n };\n\n return createTemplateAction<{\n confluenceUrls: string[];\n repoUrl: string;\n }>({\n id: 'confluence:transform:markdown',\n schema: {\n input: {\n properties: {\n confluenceUrls: {\n type: 'array',\n title: 'Confluence URL',\n description:\n 'Paste your Confluence url. Ensure it follows this format: https://{confluence+base+url}/display/{spacekey}/{page+title} or https://{confluence+base+url}/spaces/{spacekey}/pages/1234567/{page+title} for Confluence Cloud',\n items: {\n type: 'string',\n default: 'Confluence URL',\n },\n },\n repoUrl: {\n type: 'string',\n title: 'GitHub Repo Url',\n description:\n 'mkdocs.yml file location inside the github repo you want to store the document',\n },\n },\n },\n },\n async handler(ctx) {\n const confluenceConfig = getConfluenceConfig(config);\n const { confluenceUrls, repoUrl } = ctx.input;\n const parsedRepoUrl = parseGitUrl(repoUrl);\n const filePathToMkdocs = parsedRepoUrl.filepath.substring(\n 0,\n parsedRepoUrl.filepath.lastIndexOf('/') + 1,\n );\n const dirPath = ctx.workspacePath;\n let productArray: string[][] = [];\n\n ctx.logger.info(`Fetching the mkdocs.yml catalog from ${repoUrl}`);\n\n // This grabs the files from Github\n const repoFileDir = `${dirPath}/${parsedRepoUrl.filepath}`;\n await fetchPlainAction.handler({\n ...ctx,\n input: {\n url: `https://${parsedRepoUrl.resource}/${parsedRepoUrl.owner}/${parsedRepoUrl.name}`,\n targetPath: dirPath,\n },\n });\n\n for (const url of confluenceUrls) {\n const { spacekey, title, titleWithSpaces } =\n createConfluenceVariables(url);\n // This calls confluence to get the page html and page id\n ctx.logger.info(`Fetching the Confluence content for ${url}`);\n const getConfluenceDoc = await fetchConfluence(\n `/rest/api/content?title=${title}&spaceKey=${spacekey}&expand=body.export_view`,\n confluenceConfig,\n );\n if (getConfluenceDoc.results.length === 0) {\n throw new InputError(\n `Could not find document ${url}. Please check your input.`,\n );\n }\n // This gets attachments for the confluence page if they exist\n const getDocAttachments = await fetchConfluence(\n `/rest/api/content/${getConfluenceDoc.results[0].id}/child/attachment`,\n confluenceConfig,\n );\n\n if (getDocAttachments.results.length) {\n fs.mkdirSync(`${dirPath}/${filePathToMkdocs}docs/img`, {\n recursive: true,\n });\n productArray = await getAndWriteAttachments(\n getDocAttachments,\n dirPath,\n confluenceConfig,\n filePathToMkdocs,\n );\n }\n\n ctx.logger.info(\n `starting action for converting ${titleWithSpaces} from Confluence To Markdown`,\n );\n\n // This reads mkdocs.yml file\n const mkdocsFileContent = await readFileAsString(repoFileDir);\n const mkdocsFile = await YAML.parse(mkdocsFileContent);\n ctx.logger.info(\n `Adding new file - ${titleWithSpaces} to the current mkdocs.yml file`,\n );\n\n // This modifies the mkdocs.yml file\n if (mkdocsFile !== undefined && mkdocsFile.hasOwnProperty('nav')) {\n const { nav } = mkdocsFile;\n if (!nav.some((i: Obj) => i.hasOwnProperty(titleWithSpaces))) {\n nav.push({\n [titleWithSpaces]: `${titleWithSpaces.replace(/\\s+/g, '-')}.md`,\n });\n mkdocsFile.nav = nav;\n } else {\n throw new ConflictError(\n 'This document looks to exist inside the GitHub repo. Will end the action.',\n );\n }\n }\n\n await fs.writeFile(repoFileDir, YAML.stringify(mkdocsFile));\n\n // This grabs the confluence html and converts it to markdown and adds attachments\n const html = getConfluenceDoc.results[0].body.export_view.value;\n const markdownToPublish = NodeHtmlMarkdown.translate(html);\n let newString: string = markdownToPublish;\n productArray.forEach((product: string[]) => {\n // This regex is looking for either [](link to confluence) or  in the newly created markdown doc and updating it to point to the versions saved(in ./docs/img) in the local version of GitHub Repo during getAndWriteAttachments\n const regex = product[0].includes('.pdf')\n ? new RegExp(`(\\\\[.*?\\\\]\\\\()(.*?${product[0]}.*?)(\\\\))`, 'gi')\n : new RegExp(`(\\\\!\\\\[.*?\\\\]\\\\()(.*?${product[0]}.*?)(\\\\))`, 'gi');\n newString = newString.replace(regex, `$1./img/${product[1]}$3`);\n });\n\n ctx.logger.info(`Adding new file to repo.`);\n await fs.outputFile(\n `${dirPath}/${filePathToMkdocs}docs/${titleWithSpaces.replace(\n /\\s+/g,\n '-',\n )}.md`,\n newString,\n );\n }\n\n ctx.output('repo', parsedRepoUrl.name);\n ctx.output('owner', parsedRepoUrl.owner);\n },\n });\n};\n"],"names":["fs","fetch","ResponseError","ConflictError","InputError","createFetchPlainAction","createTemplateAction","parseGitUrl","YAML","NodeHtmlMarkdown"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDa,MAAA,mBAAA,GAAsB,CAAC,MAAmB,KAAA;AAtDvD,EAAA,IAAA,EAAA,CAAA;AAuDE,EAAA,MAAM,gBAAmB,GAAA;AAAA,IACvB,OAAA,EAAS,MAAO,CAAA,SAAA,CAAU,oBAAoB,CAAA;AAAA,IAC9C,IAAM,EAAA,CAAA,EAAA,GAAA,MAAA,CAAO,iBAAkB,CAAA,sBAAsB,MAA/C,IAAoD,GAAA,EAAA,GAAA,QAAA;AAAA,IAC1D,KAAA,EAAO,MAAO,CAAA,iBAAA,CAAkB,uBAAuB,CAAA;AAAA,IACvD,KAAA,EAAO,MAAO,CAAA,iBAAA,CAAkB,uBAAuB,CAAA;AAAA,IACvD,QAAA,EAAU,MAAO,CAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAAA,IAC7D,QAAA,EAAU,MAAO,CAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAAA,GAC/D,CAAA;AAEA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AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown",
|
|
3
3
|
"description": "The confluence-to-markdown module for @backstage/plugin-scaffolder-backend",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.0-next.1",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"help": "backstage-cli help"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@backstage/backend-common": "^0.19.0",
|
|
27
|
+
"@backstage/backend-common": "^0.19.1-next.0",
|
|
28
28
|
"@backstage/config": "^1.0.8",
|
|
29
|
-
"@backstage/errors": "^1.2.0",
|
|
30
|
-
"@backstage/integration": "^1.5.0",
|
|
31
|
-
"@backstage/plugin-scaffolder-backend": "^1.15.
|
|
32
|
-
"@backstage/plugin-scaffolder-node": "^0.1.
|
|
29
|
+
"@backstage/errors": "^1.2.1-next.0",
|
|
30
|
+
"@backstage/integration": "^1.5.1-next.0",
|
|
31
|
+
"@backstage/plugin-scaffolder-backend": "^1.15.1-next.1",
|
|
32
|
+
"@backstage/plugin-scaffolder-node": "^0.1.5-next.0",
|
|
33
33
|
"@backstage/types": "^1.1.0",
|
|
34
34
|
"fs-extra": "10.1.0",
|
|
35
35
|
"git-url-parse": "^13.1.0",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"yaml": "^2.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@backstage/backend-test-utils": "^0.1.
|
|
42
|
-
"@backstage/cli": "^0.22.
|
|
41
|
+
"@backstage/backend-test-utils": "^0.1.39-next.0",
|
|
42
|
+
"@backstage/cli": "^0.22.9-next.1",
|
|
43
43
|
"mock-fs": "^5.2.0",
|
|
44
44
|
"msw": "^1.0.0"
|
|
45
45
|
},
|